<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>5.5非递归阶乘</title>
</head>

<body>
    <script>
        function factorial(n) {
            var fac = 1;
            for (var i = 2; i <= n; i++){
                fac *= i;
            }
            return fac;
        }
        document.write(factorial(12)-factorial(10));
    </script>
</body>

</html>